<form action="" class="form-horizontal" role="form">

	<div class="form-group">
		<label class="col-sm-2 control-label">微联盟名称</label>
		<div class="col-sm-3">
			<input type="text" class="form-control" name="name" placeholder="" datatype="*" value="{$microAlliance.name}"/>
		</div>
	</div>
	
  <div class="form-group">
    <label class="col-sm-2 control-label">微联盟logo</label>
    <div class="col-sm-6">
      <input type="text" class="form-control margin-bottom" name="logo" id="cover" readonly placeholder="" value="{$microAlliance.logo}"/>
      <span class="btn btn-primary" id="upload-image">上传logo</span>
    </div>
  </div>
 <div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
			<input type="hidden" name="id" value="{$microAlliance.id}"/>
			<a class="btn btn-default" onclick="javascript:history.go(-1)">返回上页</a>
			<a class="btn btn-default" onclick="self.location=document.referrer">返回上页并刷新</a>
			<button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/save">保存更改</button>
		</div>
	</div>
</form>

<!-- uploadify -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/uploadify/uploadify.css">
<script type="text/javascript" src="__PUBLIC__/Style/Common/uploadify/jquery.uploadify.min.js?{:rand(0,9999)}"></script>
<script type="text/javascript">
  $("#upload-image").uploadify({
    'multi'            :  true,
    'buttonClass'      :  'margin-bottom',
    'fileSizeLimit'    :   '200kb',
    'buttonText'       :  '上传图片',
    'fileTypeDesc'     :   'Image Files',
    'fileTypeExts'     :   '*.jpg; *.png',
    'swf'              :   '__PUBLIC__/Style/Common/uploadify/uploadify.swf',
    'uploader'         :   '__MODULE__/Upload/uploadOne',
    'onUploadStart'    :  function(){},
    'onUploadSuccess'  : function(data, res){
      
      var url = eval("(" + res + ")").extra.url;
      $("#cover").val( url );      
    }
  });
  
  //经过图片路径文本框时显示预览图片
  var img = $("<img>");
  $("#cover").on("mouseover", function( e ){
	  $(this).parent().css({"position": "relative"});
	  $(img).attr( "src", $(this).val() );
	  $(img).css( {"position":"absolute", "top":0, "left":"100%", "maxWidth": "200px"} );
	  $(img).appendTo( $(this).parent() );
  });
  $("#cover").on("mouseout", function( e ){
	  $(img).remove();
  });
</script>